package com.geotmt.billingcenter.modules.rules.service.impl;

import com.geotmt.billingcenter.common.entry.StairRule;
import com.geotmt.billingcenter.modules.rules.mapper.RulesMapper;
import com.geotmt.billingcenter.modules.rules.service.RulesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description 计费规则类 实现类
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/25 17:22
 * @Version     v1
 **/
@Service
public class RulesServiceImpl implements RulesService {

    private static final Logger logger = LoggerFactory.getLogger(RulesServiceImpl.class);

    @Resource
    private RulesMapper stairMapper;

    @Override
    public Integer addStair(StairRule stairRule) {
        logger.info("addStair Service...");
        stairMapper.addStair(stairRule);
        return stairRule.getId();
    }

    @Override
    public List<StairRule> stairListGetByRid(Integer rId, Integer label) {
        logger.info("stairListGetByRid Service...");
        return stairMapper.stairListGetByRid(rId, label);
    }
}
